package com.tengju.user.domain.model.survey;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum SurveyShuffleStatusEnum {
    SHUFFLE(1,"是"),
    NO_SHUFFLE(2,"否");

    private Integer code;
    private String desc;

    SurveyShuffleStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SurveyShuffleStatusEnum parseByCode(Integer code) {
        return Arrays.stream(SurveyShuffleStatusEnum.values())
                .filter(k -> k.getCode().equals(code))
                .findFirst().orElse(NO_SHUFFLE);
    }

}
